from django.db import models

# Create your models here.
from Base.Time_Base import Create_Time_Base

# 预测式外呼任务
class Task_Test(Create_Time_Base):
    task_name = models.CharField('任务名称', max_length=64, default='')
    call_way = models.CharField('呼叫方式', max_length=11, choices=(('1','直接转坐席'),('2','播放语音任意键转坐席'),('3','播放语音按键业务场景处理'),('4','播放语音后挂断'),('5','播放语音后直接转坐席')), default='1')
    queue_id = models.CharField('班组id', max_length=32, default='')
    priority = models.CharField('任务优先级', max_length=11, default='')
    start_time = models.CharField('任务开始时间', max_length=32, default='')
    end_time = models.CharField('任务结束时间', max_length=32, default='')
    callers_group = models.CharField('用户主叫分组标识外键', max_length=11, default='')
    template =models.CharField('模板外键',max_length=11,default='')
    concurrence = models.CharField('并发', max_length=11, default='0')
    status = models.CharField('状态', max_length=11, choices=(('1', '启动'), ('2', '停止')), default='1')
    remark = models.CharField('备注',max_length=255,default='')
    sole_tag = models.CharField('唯一标识',max_length=255,default='')
    class Meta:
        db_table = 'zb_task_test'

# 线索
class Call_List(models.Model):
    number = models.CharField('被叫号码',max_length=32,default='')
    remark = models.CharField('备注', max_length=255, default='')
    status = models.CharField('状态', max_length=11, choices=(('1','未分配'),('2','已分配')), default='1')
    task = models.CharField('任务外键', max_length=11, default='')
    class Meta:
        db_table = 'zb_call_list'

# 预测式外呼用户主叫分组
class Callers_Group(Create_Time_Base):
    group_name = models.CharField('任务名称', max_length=64, default='')
    strategy = models.CharField('分配策略',max_length=11,choices=(('1','随机'),('2','轮选')))
    sole_tag = models.CharField('唯一标识', max_length=255, default='')
    class Meta:
        db_table = 'zb_callers_group'

# 用户侧显号
class UserCli(models.Model):
    number = models.CharField('侧显号',max_length=32,default='')
    remark = models.CharField('备注',max_length=255,default='')
    allers_group = models.CharField('主叫分组外键',max_length=11,default='')
    class Meta:
        db_table = 'zb_usercli'

# 坐席组
class Seats_Group(Create_Time_Base):
    group_name = models.CharField('组名',max_length=64,default='')
    group_leader = models.CharField('组长(用户ID)外键',max_length=11,default='')
    rule = models.CharField('分配规则',max_length=11,choices=(('1','随机'),('2','轮询'),('3','最少'),('4','坐席等级'),('5','空闲时长')),default='1')
    status = models.CharField('状态',max_length=11,choices=(('1','激活'),('2','未激活')),default='1')
    remark = models.CharField('备注',max_length=255,default='')
    sole_tag = models.CharField('唯一标识', max_length=255, default='')
    account_tag = models.CharField('企业唯一标识', max_length=255, default='')
    class Meta:
        db_table = 'zb_seats_group'

# 坐席及组关联
class Seats_Group_Relevance(models.Model):
    seats_group = models.CharField('坐席组外键',max_length=11,default='')
    seats = models.CharField('坐席外键',max_length=11,default='')
    seats_number = models.CharField('坐席号',max_length=32,default='')
    sip_number = models.CharField('SIP账号',max_length=64,default='')
    class Meta:
        db_table = 'zb_seats_group_relrvance'


